using UnityEngine;
using System.Collections;

public abstract class AbstractElement : MonoBehaviour, IQuadObject{
	
	public event QuadObjectEvent BoundsChanged;
	
	protected Rect _bounds;
	
	
	public bool IsTrigger { get; protected set; }
	public bool IsDestroyed { get; protected set; }
	public Rect localBounds { get { return _bounds; }}
	public Rect worldBounds { 
		get {
			Vector3 p = transform.position;
			Rect wb = _bounds;
			wb.x += p.x;
			wb.y += p.y;
			
			return wb;
		}
	}
	
	public virtual void Create(Rect bounds){
		_bounds = bounds;
	}
	
	public virtual void OnContactAdded(){
		
	}
	public virtual void OnContactRemoved(){
		
	}
	
}

